[
    {
        "id": "9c78f3e70aecce9f",
        "type": "tab",
        "label": "Local Tunnel",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a885d8cb39f347e8",
        "type": "inject",
        "z": "9c78f3e70aecce9f",
        "name": "CREATE",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "Command",
                "v": "CREATE",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 100,
        "y": 180,
        "wires": [
            [
                "5500db432a6c7fd2"
            ]
        ]
    },
    {
        "id": "7dddfe45321dda92",
        "type": "inject",
        "z": "9c78f3e70aecce9f",
        "name": "OPEN",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "Command",
                "v": "OPEN",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{}",
        "payloadType": "json",
        "x": 90,
        "y": 300,
        "wires": [
            [
                "8eb3b73956d04d6c"
            ]
        ]
    },
    {
        "id": "d72ddae053956915",
        "type": "inject",
        "z": "9c78f3e70aecce9f",
        "name": "DELETE",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "Command",
                "v": "DELETE",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{}",
        "payloadType": "json",
        "x": 100,
        "y": 380,
        "wires": [
            [
                "6266c0f735293094"
            ]
        ]
    },
    {
        "id": "292fc9b847e5f189",
        "type": "inject",
        "z": "9c78f3e70aecce9f",
        "name": "CLOSE",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "Command",
                "v": "CLOSE",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{}",
        "payloadType": "json",
        "x": 90,
        "y": 340,
        "wires": [
            [
                "8eb3b73956d04d6c"
            ]
        ]
    },
    {
        "id": "2aea3326917ec6cb",
        "type": "debug",
        "z": "9c78f3e70aecce9f",
        "name": "Check Tunnel Info",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 1050,
        "y": 180,
        "wires": []
    },
    {
        "id": "7e9b0b8e296b2a69",
        "type": "comment",
        "z": "9c78f3e70aecce9f",
        "name": "Open a local tunnel using the appropriate commands.",
        "info": "",
        "x": 240,
        "y": 60,
        "wires": []
    },
    {
        "id": "c641d861083a4b7c",
        "type": "comment",
        "z": "9c78f3e70aecce9f",
        "name": "1. Configure the tunnel properties and Create the tunnel",
        "info": "",
        "x": 400,
        "y": 140,
        "wires": []
    },
    {
        "id": "8eb3b73956d04d6c",
        "type": "change",
        "z": "9c78f3e70aecce9f",
        "name": "Load Tunnel Info",
        "rules": [
            {
                "t": "set",
                "p": "TunnelId",
                "pt": "msg",
                "to": "#:(file)::myTunnel.id",
                "tot": "flow",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 330,
        "y": 320,
        "wires": [
            [
                "5500db432a6c7fd2"
            ]
        ]
    },
    {
        "id": "2cb9309145681335",
        "type": "comment",
        "z": "9c78f3e70aecce9f",
        "name": "2. Control the Tunnel with the saved tunnel info",
        "info": "",
        "x": 200,
        "y": 260,
        "wires": []
    },
    {
        "id": "381cdfd071b0e4bb",
        "type": "change",
        "z": "9c78f3e70aecce9f",
        "name": "Save Tunnel info",
        "rules": [
            {
                "t": "set",
                "p": "#:(file)::myTunnel",
                "pt": "flow",
                "to": "{}",
                "tot": "json"
            },
            {
                "t": "set",
                "p": "#:(file)::myTunnel.id",
                "pt": "flow",
                "to": "TunnelId",
                "tot": "msg"
            },
            {
                "t": "set",
                "p": "#:(file)::myTunnel.name",
                "pt": "flow",
                "to": "TunnelName",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "d553f6071fac06e8",
        "type": "switch",
        "z": "9c78f3e70aecce9f",
        "name": "Success?",
        "property": "TunnelStatus",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "created",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 680,
        "y": 200,
        "wires": [
            [
                "381cdfd071b0e4bb"
            ]
        ]
    },
    {
        "id": "5500db432a6c7fd2",
        "type": "smeTunnel",
        "z": "9c78f3e70aecce9f",
        "connector": "",
        "name": "myNewTunnel",
        "host": "localhost",
        "port": "1880",
        "path": "/",
        "retryInterval": 10,
        "retryTimeout": 0,
        "x": 420,
        "y": 180,
        "wires": [
            [
                "d553f6071fac06e8",
                "2aea3326917ec6cb"
            ]
        ]
    },
    {
        "id": "6266c0f735293094",
        "type": "change",
        "z": "9c78f3e70aecce9f",
        "name": "Load and Delete Tunnel Info",
        "rules": [
            {
                "t": "set",
                "p": "TunnelId",
                "pt": "msg",
                "to": "#:(file)::myTunnel.id",
                "tot": "flow",
                "dc": true
            },
            {
                "t": "delete",
                "p": "#:(file)::myTunnel",
                "pt": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 360,
        "y": 380,
        "wires": [
            [
                "5500db432a6c7fd2"
            ]
        ]
    }
]